<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>image upload example</h1>
  <form method="POST" class="post-form" enctype="multipart/form-data">
  {% csrf_token %}
  {{ form.as_p }}
  <button type="submit" class="save btn btn-default" value="upload">保存</button>
  </form>

{% if uploaded_file_url %}
  <img src="{{ uploaded_file_url }}">
  <p>File uploaded at: <a href="{{ uploaded_file_url }}">{{ uploaded_file_url }}</a></p>
  {% endif %}

<p><a href="{% url 'uimage' %}">返回首页</a></p>
</body>
</html>